Using Scripting Understanding scripting will give you a great set of new abilities and ways to use Snak. You can use scripting to complement or even replace some of the built in commands with aliases to provide enhanced functionality. The /msg and /query aliases in the basical script file are examples of this. They redefine the built in commands of the same names to allow you to use abbreviated nicks for the people you send private messages to. Aliases are also used to provide shortcuts for frequently used commands like /join. For examples the /j alias simply calls the /join command. Introduction Snak supports two different scripting languages - AppleScript and ircII and come with extensive examples of scripts written in both languages. A script is a mini-program with variables and functions. An alias is one kind of a script, an entry in the Tools menu is another. An alias complements the built-in commands and is used the same way. The two languages differ in their focus, their access to the internal data of Snak, their ease of use and their speed, but you can use scripts written in both languages side by side to get the most benefits of both environments. Scripts are stored in files in the script folder, which is automatically created if missing. Scrips in the ircII language are regular text files that can easily be edited with a text editor, like BBEdit or even SimpleText. If you edit them in a word processor, please take care to save the files as pure text without formatting. AppleScripts are created with the Script Editor application that comes with the Macintosh OS. There are also third party script editors and debuggers available that will let you examine a script while it is running to easily debug it. IMPORTANT: AppleScripts must be saved in compiled form in order for Snak to use them. For both types of scripts, be sure not to include spaces in the filename under which you save them. When you open a connection, the program will read in the contents of the basical and action script files from the Script folder. These files contain aliases that extends the built-in command set and serves as examples of how to extend and modify Snaks behavior. The files have informative comments and explanations to help you understand what is going on. Each connection maintains its own list of loaded scripts, so that you can modify the behavior and use of each connection. For example, one connection could be used to run a bot and another could be used normally. Included with Snak is a complete script package called PurePak, which contains extensive functionality for both channel operators and normal IRC users. It can maintain list of friends and enemies on IRC that can be set up to auto-op friends and try to avoid enemies. It has functions for channel management, and file exchange, and it comes with extensive built-in help. To load purepak, type "/load purepak.irc" and notice the intro messages that come up. The built-in help is accessed with /pphelp and an optional topic like /pphelp main. Scripts can be complex multi-line programs like PurePak or they can simply be used to abbreviate frequently used commands. It is too big a subject to cover in detail in these chapters, so you are encouraged to study the example script files that come with the program to learn details.